extern const int cUnitPicker = 0;
extern const int cNumResourceTypes = 3;
extern const int cDeckID = 0;
extern bool gAgingUp = false;
extern int gArrayTier1Treasures = -1;
extern int gArrayTier2Treasures = -1;
extern int gArrayTier3Treasures = -1;
extern int gArrayTier1TreasuresHP = -1;
extern int gArrayTier2TreasuresHP = -1;
extern int gArrayTier3TreasuresHP = -1;
extern bool gTreasureHuntingMode = false;
extern bool gRangatiraRecoveryMode = false;
extern bool gRangatiraDefendMode = false;
extern int gTreasure = -1;
extern int gTreasureTier = 1;
extern bool gFarmingMode = false;
extern int gMarksmenPlan = -1;
extern int gSpearmenPlan = -1;
extern int gBallistaPlan = -1;
extern bool gWeAreReligious = false;


mutable void initArrays(void){}


float abs(float n = 0.0)
{
    if (n < 0.0)
        return(0.0 - n);
    return(n);
}


bool xsOutOfBounds(vector v = cOriginVector, bool circular = true)
{
    if (circular)
        return(xsVectorLength(v - kbGetMapCenter()) > kbGetMapXSize()*0.501);
    return((kbGetMapXSize() < xsVectorGetX(v)) || (kbGetMapZSize() < xsVectorGetZ(v)));
}

